{template 'header', $module}

	<div class="tinfo">
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="add"><a href="favorite.php?action=add"><span>添加收藏</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="home"><a href="favorite.php"><span>房源收藏</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="type"><a href="javascript:Dwidget('type.php?item=favorite', '[收藏分类]', 600, 300);"><span>收藏分类</span></a></td>
</tr>
</table>
</div>
{if $action == 'add'}
<form method="post" action="favorite.php" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">分类 </td>
<td class="tr">{$type_select}&nbsp; <a href="javascript:Dwidget('type.php?item=favorite', '[收藏分类]', 600, 300);" class="t">[管理分类]</a></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 标题</td>
<td class="tr"><input type="text" size="45" name="post[title]" id="title" value="{$title}"/> {dstyle('post[style]')} <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 网址</td>
<td class="tr"><input type="text" size="60" name="post[url]" id="url" value="{$url}"/> <span id="durl" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">备注</td>
<td class="tr"><input type="text" size="60" name="post[note]" id="note"/></td>
</tr>
<tr>
<td class="tl"> </td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 确 定 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="sBtn"/></td>
</tr>
</table>
</form>
<script type="text/javascript">s('favorite');m('add');</script>
{elseif $action == 'edit'}
<form method="post" action="favorite.php" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellspacing="1" cellpadding="5" class="tb">
<tr>
<td class="tl">分类</td>
<td class="tr">{$type_select}&nbsp; <a href="javascript:Dwidget('type.php?item=favorite', '[收藏分类]', 600, 300);" class="t">[管理分类]</a></td>
</tr>
<tr>
<td class="tl">显示顺序</td>
<td class="tr f_gray"><input type="text" size="3" name="post[listorder]" id="listorder" value="{$listorder}"/> 请填写数字，数字越大越靠前</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 标题</td>
<td class="tr"><input type="text" size="45" name="post[title]" id="title" value="{$title}"/> {dstyle('post[style]', $style)} <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 网址</td>
<td class="tr"><input type="text" size="60" name="post[url]" id="url" value="{$url}"/> <span id="durl" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">备注</td>
<td class="tr"><input type="text" size="60" name="post[note]" id="note" value="{$note}"/></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 修 改 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
<script type="text/javascript">s('favorite');m('home');</script>
{else}
<form action="favorite.php">
<div class="tt">
&nbsp;{$fields_select}&nbsp;
<input type="text" size="50" name="kw" value="{$kw}" title="关键词"/>&nbsp;
{$type_select}&nbsp;
<input type="submit" value=" 搜 索 " class="sBtn"/>&nbsp;
<input type="button" value=" 重 置 " class="sBtn" onclick="Go('favorite.php');"/>
</div>
</form>
<div class="ls">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th>分类</th>
<th>标题</th>
<th width="150">添加时间</th>
<th width="80">管理</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center" title="备注:{$v[note]}">
<td>&nbsp;<a href="favorite.php?typeid={$v[typeid]}">{$v[type]}</a>&nbsp;</td>
<td align="left">&nbsp;<a href="{$v[url]}" target="_blank" class="t">{$v[title]}</a></td>
<td class="f_gray px11">{$v[adddate]}</td>
<td>
<a href="favorite.php?action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a>&nbsp;
<a href="favorite.php?action=delete&itemid={$v[itemid]}" onclick="return confirm('确定要删除吗？此操作将不可撤销');"><img width="16" height="16" src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/delete.png" title="删除" alt=""/></a>
</td>
</tr>
{/loop}
</table>
</div>
</form>
{if $MG[favorite_limit]}
<div class="limit">收藏夹容量 <span class="f_b f_red">{$MG[favorite_limit]}</span> 条&nbsp;&nbsp;&nbsp;当前已收藏 <span class="f_b">{$limit_used}</span> 条&nbsp;&nbsp;&nbsp;还可以收藏 <span class="f_b f_blue">{$limit_free}</span> 条</div>
{/if}
<div class="pages">{$pages}</div>
<script type="text/javascript">s('favorite');m('home');</script>
{/if}
{if $action=='add' || $action=='edit'}
<script type="text/javascript">
function check() {
	if(Dd('title').value.length < 2) {
		Dmsg('请填写标题', 'title');
		return false;
	}
	if(Dd('url').value.length < 12) {
		Dmsg('请填写网址', 'url');
		return false;
	}
	return true;
}
</script>
{/if}
</div></div>
</div>
{template 'footer'}